import http from "@/api/config/http";
import { IQuery } from "@/interface/IAxios";

// 查询菜单列表
export function listMenu(query?: IQuery) {
  return http.request({
    url: "/system/menu/list",
    method: "get",
    params: query
  });
}

// 查询菜单下拉树结构
export function treeselect() {
  return http.request({
    url: "/system/menu/treeselect",
    method: "get"
  });
}

// 查询菜单详细
export function getMenu(menuId: string) {
  return http.request({
    url: `/system/menu/${menuId}`,
    method: "get"
  });
}

// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId: string) {
  return http.request({
    url: `/system/menu/roleMenuTreeselect/${roleId}`,
    method: "get"
  });
}

// 获取路由
export const getRouters = () => {
  return http.request({
    url: "/getRouters",
    method: "get"
  });
};
